package com.example.design.proxyDemo.cglibProxy;

import net.sf.cglib.proxy.Enhancer;

public class TestCglibHandler {

  public static void main(String[] args) {
    CglibMethodInterceptor cglibMethodInterceptor = new CglibMethodInterceptor();
    Enhancer enhancer = new Enhancer();
    enhancer.setCallback(cglibMethodInterceptor);
    enhancer.setSuperclass(TestService.class);
    TestService testService = (TestService) enhancer.create();
    testService.service();
  }

}
